// 分类管理页面样式
@use '../variables' as *;
.category-list {
    // 示例数据提示样式
    .sample-data-notice {
        margin-bottom: 16px;
        border-radius: $radius-lg;
        background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
        border: 1px solid #ffc107;
         :deep(.el-alert__title) {
            color: #856404;
            font-weight: $font-semibold;
        }
         :deep(.el-alert__description) {
            color: #856404;
        }
         :deep(.el-alert__icon) {
            color: #ffc107;
        }
    }
    .action-section {
        background: white;
        border-radius: $radius-lg;
        padding: 24px;
        margin-bottom: 24px;
        box-shadow: $shadow-md;
        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            h2 {
                margin: 0;
                font-size: 1.5rem;
                font-weight: $font-bold;
                color: $text-primary;
            }
            .header-actions {
                display: flex;
                align-items: center;
                gap: 16px;
                .search-box {
                    min-width: 300px;
                     :deep(.el-input__wrapper) {
                        border-radius: $radius-md;
                        background-color: #f8f9fa;
                        border: 1px solid #e1e5e9;
                        transition: all 0.3s ease;
                        &:hover {
                            border-color: #c0c4cc;
                            background-color: #ffffff;
                        }
                        &:focus-within {
                            border-color: #409eff;
                            background-color: #ffffff;
                            box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
                        }
                    }
                     :deep(.el-input__inner) {
                        color: $text-primary;
                        font-size: 14px;
                        &::placeholder {
                            color: #909399;
                        }
                    }
                }
            }
        }
    }
    .table-section {
        background: white;
        border-radius: $radius-lg;
        padding: 24px;
        box-shadow: $shadow-md;
        .category-name {
            display: flex;
            align-items: center;
            gap: 8px;
            min-height: 20px;
            line-height: 1;
            .name-text {
                font-weight: $font-medium;
                color: $text-primary;
                line-height: 1.4;
                vertical-align: middle;
                display: inline-block;
            }
        }
         :deep(.el-table) {
            border-radius: $radius-lg;
            overflow: hidden;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
            .el-table__header {
                th {
                    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
                    color: $text-primary;
                    font-weight: $font-semibold;
                    border-bottom: 2px solid #e9ecef;
                    padding: 16px 12px;
                }
            }
            .el-table__row {
                transition: all $transition-normal;
                &:hover {
                    background-color: rgba(102, 126, 234, 0.05);
                    transform: translateY(-1px);
                    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
                }
                td {
                    padding: 16px 12px;
                    border-bottom: 1px solid #f1f3f4;
                    vertical-align: middle;
                    line-height: 1;
                }
            }
            // 树形表格样式
            .el-table__expand-icon {
                width: 20px;
                height: 20px;
                border-radius: 50%;
                background: rgba(102, 126, 234, 0.1);
                display: inline-flex;
                align-items: center;
                justify-content: center;
                transition: all 0.3s ease;
                margin-right: 8px;
                vertical-align: middle;
                position: relative;
                top: 0;
                &:hover {
                    background: rgba(102, 126, 234, 0.2);
                    transform: scale(1.1);
                }
                .el-table__expand-icon-inner {
                    color: #667eea;
                    font-size: 12px;
                    font-weight: bold;
                    transition: all 0.3s ease;
                    line-height: 1;
                }
                // 展开状态
                &.el-table__expand-icon--expanded {
                    background: rgba(102, 126, 234, 0.2);
                    .el-table__expand-icon-inner {
                        transform: rotate(90deg);
                    }
                }
            }
            // 确保表格单元格内容垂直居中
            .el-table__cell {
                .cell {
                    display: flex;
                    align-items: center;
                    min-height: 20px;
                }
            }
            // 操作列样式
            .el-table__cell:last-child {
                .cell {
                    padding: 8px 0;
                }
            }
        }
        // 表格内容样式
        .count-tag {
            font-weight: $font-medium;
            border-radius: 12px;
        }
        .sort-number {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 24px;
            height: 24px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border-radius: 50%;
            font-size: 12px;
            font-weight: $font-medium;
        }
        // 操作栏样式
        .action-buttons {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            .action-btn {
                display: inline-flex;
                align-items: center;
                gap: 4px;
                height: 32px;
                padding: 0 12px;
                font-size: 12px;
                border-radius: 6px;
                transition: all $transition-normal;
                &:hover {
                    transform: translateY(-1px);
                    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
                }
                .el-icon {
                    font-size: 14px;
                }
            }
            .more-btn {
                .el-icon--right {
                    margin-left: 2px;
                }
            }
        }
        // 下拉菜单样式
         :deep(.el-dropdown-menu) {
            .el-dropdown-item {
                display: flex;
                align-items: center;
                gap: 8px;
                padding: 8px 16px;
                .el-icon {
                    font-size: 14px;
                }
                &:hover {
                    background-color: #f5f7fa;
                }
            }
        }
    }
    // 对话框样式
     :deep(.el-dialog) {
        .el-dialog__header {
            border-bottom: 1px solid $border-light;
            padding: 20px 24px 16px;
            .el-dialog__title {
                font-weight: $font-bold;
                color: $text-primary;
            }
        }
        .el-dialog__body {
            padding: 24px;
        }
        .el-dialog__footer {
            border-top: 1px solid $border-light;
            padding: 16px 24px 20px;
            .dialog-footer {
                display: flex;
                justify-content: flex-end;
                gap: 12px;
            }
        }
    }
    // 表单样式
     :deep(.el-form) {
        .el-form-item {
            margin-bottom: 20px;
            .el-form-item__label {
                font-weight: $font-medium;
                color: $text-primary;
            }
            .el-input__wrapper,
            .el-textarea__inner {
                border-radius: $radius-md;
                border: 1px solid $border-light;
                transition: all $transition-normal;
                &:hover {
                    border-color: #667eea;
                }
                &.is-focus {
                    border-color: #667eea;
                    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
                }
            }
        }
    }
}

// 响应式设计
@media (max-width: 768px) {
    .category-list {
        .action-section {
            .section-header {
                flex-direction: column;
                gap: 16px;
                align-items: stretch;
                h2 {
                    text-align: center;
                }
            }
        }
        .table-section {
            padding: 16px;
            overflow-x: auto;
            // 移动端操作栏样式
            .action-buttons {
                flex-direction: column;
                gap: 6px;
                align-items: stretch;
                .action-btn {
                    justify-content: center;
                    height: 36px;
                    font-size: 13px;
                }
            }
        }
    }
}